package com.neouton.crm.supplier.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.common.entity.ActivitiVO;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.supplier.entity.SupplierVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface SupplierMapper {

    /**
     * 多条件分页查询客户信息列表
     * @Timestamp: 2022-11-18
     * @Author: WuJie
     * @param page 分页信息
     * @param supplierVO 其余查询条件
     * @return 分页查询结果
     */
    IPage<SupplierVO> querySupplierByPage(@Param("page")IPage page, @Param("supplierVO")SupplierVO supplierVO,@Param("orderBy")String orderBy);


    /**
     * 保存工商信息
     * @Timestamp: 2022-11-17
     * @Author: WuJie
     * @param supplierVO 需更新实体
     * @return 成功失败
     */
    Boolean insertSupplier(@Param("supplierVO") SupplierVO supplierVO);

    /**
     * 更新客户信息
     * @Timestamp: 2022-11-18
     * @Author: WuJie
     * @param supplierVO 需更新实体
     * @return 成功失败
     */
    Boolean updateSupplier(@Param("supplierVO")SupplierVO supplierVO);


    /**
     * 删除工商信息
     * @Timestamp: 2022-11-22
     * @Author: WuJie
     * @param supplierId 需删除的ID
     * @return 成功失败
     */
    Boolean deleteSupplierById(@Param("supplierId")Integer supplierId,@Param("modifier")Integer modifier);
    Boolean enableSupplierById(@Param("supplierId")Integer supplierId,@Param("modifier")Integer modifier);

    SupplierVO querySupplier(@Param("supplierVO")SupplierVO supplierVO);


    Boolean updateIsCustomer();

    SupplierVO selectSupplierById(@Param("supplierId")Integer supplierId);

    Boolean updateSupplierById(@Param("supplierVO")SupplierVO supplierVO);

    List<SupplierVO> selectAllEnterprise();

    List<SupplierVO> selectAllSupplier();

    List<SupplierVO> queryAllSupplier(@Param("supplierVO")SupplierVO supplierVO);

    List<SupplierVO> queryTodoSupplierByApprovalId(@Param("approvalId") Integer approvalId);

    void backSupplierData(@Param("supplierVO")SupplierVO supplierVO);

    List<SupplierVO> queryTHistorySupplierByApprovalId(Integer approvalId);

    Boolean forbiddenCustomerByApplyId(@Param("approvalId")Integer approvalId, @Param("userId")Integer userId, @Param("isDelete")Integer isDelete);

    IPage getSupplierToDoList(@Param("page")IPage page, @Param("supplierVO")SupplierVO supplier, @Param("orderBy")String orderBy, @Param("activitiVOS")List<ActivitiVO> activitiVOS);

    IPage getSupplierDoneList(@Param("page")IPage page, @Param("supplierVO")SupplierVO supplier, @Param("orderBy")String orderBy);

    IPage getSupplierRecordsList(@Param("page")IPage page, @Param("supplierVO")SupplierVO supplier, @Param("orderBy")String orderBy, @Param("userList")List<SysUserEntity> userList);

    SupplierVO getSupplierDocumentaryViewInfo(Integer supplierId);
}
